<!-- $def with (newers, users, citys, targets) -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>weapho</title>
</head>
<body>
<div class="toper"><h1>后台管理</h1></div>
<hr />
<div class="sign">
	<h2>用户申请信息</h2>
	<table border=1>
		<tr>
			<th>手机号</th><th>订阅城市</th><th>留言</th><th>&nbsp;</th>
		</tr>
		% for new in newers:
		<tr><td>${new.phone}</td><td>${new.city}</td><td>${new.msg}</td><td><a href="donew?id=${new.id}">已处理</a></td></tr>
		% endfor
	</table>
</div>
<div class="users">
	<h2>已订阅用户管理</h2>
	<table border=1>
		<tr>
			<th>序号</th><th>飞信号</th><th>昵称</th><th>手机号</th><th>订阅城市</th><th>&nbsp;</th>
		</tr>
		% for user in users:
		<tr>
			<td>${user.userid}</td>
			<td>${user.fetionsip}</td>
			<td>${user.nickname}</td>
			<td>${user.cellphone}</td>
			<td><ul>
			% for target in targets:
				% if target.sip == user.fetionsip:
				<li>${target.city} <a href="deltarget?sip=${target.sip}&city=${target.city}">[x]</a>
				% endif
			% endfor
			<li><a href="addtarget?sip=${user.fetionsip}">add</a>
			</ul></td>
			<td><a href="deluser?id=${user.userid}">del</a></td>
			</tr>
		% endfor
		<tr>
			<form method="post" action="addnew">
				<td></td><td><input type="text" name="sip" style="width: 100px"></td>
				<td><input type="text" name="nick" style="width: 80px"></td>
				<td><input type="text" name="cell" style="width: 120px"></td>
				<td><select name="city" style="width: 160px">
				% for city in citys:
					<option value="${city.cityname}">${city.cityname}
				% endfor
				</select></td>
				<td><input type="submit" value="添加"></td>
			</form>
		</tr>
	</table>
</div>
<div class="citys">
	<h2>城市管理</h2>
	<table border=1>
		<tr>
			<th>ID</th><th>名称</th><th>信息源</th><th>&nbsp;</th>
		</tr>
		% for city in citys:
		<tr>
			<td>${city.cityid}</td><td>${city.cityname}</td><td>${city.uri}</td><td><a href="delcity?id=${city.cityid}">del</a></td>
		</tr>
		% endfor
		<tr>
		<form method="post" action="addcity">
			<td></td><td><input type="text" name="cityname" style="width: 50px"></td><td><input type="text" name="uri" style="width: 450px"></td><td><input type="submit" value="添加"></td>
		</form>
		</tr>
	</table>
</div>
<br><hr>
<div class="footer">
<a href="/">Home</a> | <a href="logout">Logout</a>
</div>
</body>
</html>